package com.ssm.sport.controller;

import com.ssm.sport.entity.Banner;
import com.ssm.sport.service.BannerService;
import com.ssm.sport.vo.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 前台轮播图控制器
 */
@RestController
@RequestMapping("/api/banners")
public class FrontBannerController {

    @Autowired
    private BannerService bannerService;

    /**
     * 获取所有启用的轮播图列表
     */
    @GetMapping
    public ResponseVO list() {
        List<Banner> banners = bannerService.listEnabledBanners();
        return ResponseVO.success(banners);
    }
} 